<include file="Public/common" />
<block name="css">
    <link rel="stylesheet" type="text/css" href="__JS__/jedate/skin/jedate.css">
    <link rel="stylesheet" type="text/css" href="__CSS__/Index/index.css">
</block>
<block name="content">
    <div class="page-header"><h1> 首页&gt; 数据统计</h1></div>
    <form action="" class="clearfix">
    <section id="dataCount" class="col-xs-12 row">
        <!-- 饼状图 -->
        <section class="data col-xs-6">
            <div class="row">
                <div class="col-xs-2"></div>
                <label for="circDate" class="col-xs-2 position-top">日期选择</label>
                <div class="col-xs-4">
                    <input id="circDate" name="day" value="<if condition="$_GET['day']">{$_GET['day']}</if>" type="text"  class="form-control" />
                </div>
                <div class="col-xs-2">
                    <button class="btn btn-primary ">查询</button>
                </div>
            </div>
            <div id="pieChart" class="shape"></div>
            <div id="pieChart2" class="shape"></div>
        </section>

        <!-- 条形图 -->
        <section  class="data col-xs-6">
            <div class="row">
                <div class="col-xs-2 position-top">
                    <select name="choose" id="dateChange">
                        <option value="0"  <php>if($_GET['month'] && !$_GET['choose']) echo 'selected';</php> >月</option>
                        <option value="1" <php>if($_GET['years'] && $_GET['choose']) echo 'selected';</php>>年</option>
                    </select>
                </div>
                <div class="col-xs-4">
                    <select id="selectYear" <php>if(!($_GET['years'] && $_GET['choose'])) echo 'style="display:none;"';</php> name="years">
                        <foreach name="years" item="v">
                            <option <if condition="$v eq $selectYear">selected</if> value="{$v}">{$v}</option>
                        </foreach>
                    </select>
                    <input id="barDate"  <php>if(($_GET['years'] && $_GET['choose'])) echo 'style="display:none;"';</php> value='<if condition="$_GET['month']">{$_GET['month']}</if>' name="month" type="text"  class="form-control" />
                </div>
                <div class="col-xs-2">
                    <button class="btn btn-primary ">查询</button>
                </div>
            </div>
            <div id="barChart" class="bar-shape"></div>
        </section>
    </section>

     <include file="Index/news" />

   <!-- </form>
    <ul id="nav" class="nav nav-tabs">
        <if condition="checkAuth('Operator/Product/lineList')">
            <li role="presentation" class=""><a data-index="0" onclick="javascript:changePage(this)">线路审核/上架</a></li>
        </if>
        <if condition="checkAuth('Operator/SaleManger/orderList')">
            <li role="presentation" class=""><a data-index="1" onclick="javascript:changePage(this)">订单确认</a></li>
        </if>
        <if condition="checkAuth('Operator/Finance/settlement_list')">
            <li role="presentation" class=""><a data-index="2" onclick="javascript:changePage(this)">线路结算</a></li>
        </if>
        <if condition="checkAuth('Operator/Index/waitAuditUnitShop')">
            <li role="presentation" class=""><a data-index="3" onclick="javascript:changePage(this)">商家审核</a></li>
        </if>
        <if condition="checkAuth('Operator/Index/waitAuditUnitGoods')">
            <li role="presentation" class=""><a data-index="4" onclick="javascript:changePage(this)">产品审核</a></li>
        </if>
    </ul>
    <iframe id="iframe" src="/Operator/Product/lineList/changeTitle/1"></iframe>-->
</block>
<block name="js">

<script src="__JS__/jedate/jedate.js"></script>
<script src="__JS__/highcharts.js"></script>
<script src="__JS__/index/welcome.js"></script>
<script>
createPieChart($('#pieChart'), '日订单统计', [['已处理订单( {$day['deal']|default=0})',   {$day['deal']?$day['deal']:1}],['未处理订单({$day['wait']|default=0})', {$day['wait']|default=0}]]);

createPieChart($('#pieChart2'), '日营业额统计', [['成本({$day['closing_total_money']|default=0})', {$day['closing_total_money']?$day['closing_total_money']:1}],['利润( {$day['profit']|default=0})',{$day['profit']|default=0}]]);

<if condition="$_GET['years'] && $_GET['choose']">
createBarChart('年营业额统计', JSON.parse({$right['conf']}), JSON.parse({$right['orderNum']}), JSON.parse({$right['profit']}), JSON.parse({$right['endNeedPay']}));
<else/>
createBarChart('月营业额统计', JSON.parse({$right['conf']}), JSON.parse({$right['orderNum']}), JSON.parse({$right['profit']}), JSON.parse({$right['endNeedPay']}));
</if>

</script>
</block>
